package com.zeratul.cloud.demo1.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/config")
public class ConfigTestController {

    @Autowired
    private Environment environment;

    @GetMapping
    public String getConfig(String key){
        return environment.getProperty(key);
    }
}
